package unique_snowflake

import (
	"fmt"
	"github.com/bwmarrin/snowflake"
)

var node *snowflake.Node

func Init() {
	var err error
	node, err = snowflake.NewNode(1)
	if err != nil {
		fmt.Println("error when generating unique node")
	}
}

func Generate() int64 {
	return int64(node.Generate())
}
